﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.2.min.js"></script>    
    <script>    
        $(function () {
            $.get('jsonHandler.ashx?chat=1&method=getAll', function (data) {
                $('#divChat').html(data);
                //alert('Load was performed.');
            });
        });
        function addChatItem() { 
        
        }
        function doLoadChat() { 
        
        }
        function postChat() {
            var u = "jsonHandler.ashx" + location.search;
            var msg = $("#txtMsg").val();

            var d = { m: msg, chat: 1 };
            
            $.ajax({
                url: u,
                contentType: "application/json",
                dataType: 'json',
                data: d,
                success: function () { alert("sent"); },
                error: function () { },
                complete: function () { }
            });
            return false;
        }
    </script>
</head>
<body>
<input type="hidden" value="0" id="hdnLastTimeStamp" />
<textarea id="txtMsg" style="height:40px;width:100%" ></textarea>
<input type="button" id="btnSend" value="Send" onclick="return postChat();" />

Page content to display
<div id="divChat"></div>
</body>
</html>
